import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("ripple"),
      ),
      body: Container(
        color: Colors.white,
        child: Center(
          child: Column(
            children: <Widget>[
              SizedBox(
                height: 20,
              ),
              buildFlatButton(),
              Visibility(
                visible: false,
                maintainSize: true,
                maintainState: true,
                maintainAnimation: true,
                child: SizedBox(
                  height: 20,
                ),
              ),
              buildRaisedButton(),
              SizedBox(
                height: 20,
              ),
              buildOutlineButton(),
              SizedBox(
                height: 20,
              ),
              buildIconButton(),
              SizedBox(
                height: 20,
              ),
              RaisedButton(
                onPressed: _onPressed,
                color: Colors.white,
                child: Icon(Icons.print),
              ),
              RaisedButton.icon(onPressed: _onPressed, icon: Icon(Icons.print), label: Text("aa")),
              SizedBox(
                height: 40,
                width: 60,
                child: FlatButton(

                  onPressed: _onPressed,
                  child: Icon(Icons.star),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }

  Material buildIconButton() {
    return Material(
      color: Colors.white,
      child: IconButton(
        iconSize: 30,
        padding: EdgeInsets.all(0),
        highlightColor: Colors.blue,
        splashColor: Colors.redAccent,
        icon: Icon(Icons.thumb_up),
        onPressed: () {
          print("icon button pressed");
        },
      ),
    );
  }

  SizedBox buildOutlineButton() {
    return SizedBox(
      height: 40,
      width: 150,
      child: OutlineButton(
        onPressed: _onPressed,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Icon(Icons.search),
            SizedBox(
              width: 10,
            ),
            Text("aaa"),
          ],
        ),
      ),
    );
  }

  SizedBox buildRaisedButton() {
    return SizedBox(
      height: 40,
      width: 150,
      child: RaisedButton(
          color: Colors.blue,
          elevation: 5,
          shape: RoundedRectangleBorder(
            side: BorderSide.none,
            borderRadius: BorderRadius.all(
              Radius.circular(25),
            ),
          ),
          onPressed: _onPressed,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Icon(Icons.search),
              SizedBox(
                width: 10,
              ),
              Text("aaa"),
            ],
          )),
    );
  }

  SizedBox buildFlatButton() {
    return SizedBox(
      height: 40,
      width: 150,
      child: FlatButton(
        shape: RoundedRectangleBorder(
          side: BorderSide.none,
          borderRadius: BorderRadius.all(
            Radius.circular(25),
          ),
        ),
        color: Colors.redAccent,
        onPressed: _onPressed,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Icon(Icons.search),
            SizedBox(
              width: 10,
            ),
            Text("aaa"),
          ],
        ),
      ),
    );
  }

  _onPressed() {
    print("on pressed");
  }
}
